<?php

use Dingo\Api\Routing\Router;
use \App\Commons\Utils\RouterActionPrefixTools;
use App\Admin\Controller\Example\ExampleController;

/** @var Router $api */
$api = app(Router::class);

$api->group(['prefix' => 'ex'], function (Router $api) {//模块前缀
    
    $api->group(['prefix' => 'example'], function (Router $api) {//控制器前缀,每个控制器一个
        
        $rapt = new RouterActionPrefixTools(ExampleController::class);
        
        /** @see ExampleController::page() 获取示例页面 */
        $api->post('page', $rapt->getAction('page'));
    });
    
});